import ExampleSCM.*;
import TemplateCode.Handler;
import TemplateCode.HandlerMark;
import TemplateCode.HandlerSpace;
import TemplateCode.HandlerUpper;

public class Main {
    public static void main(String[] args) {
        System.out.println("------------责任链模式-模版--------------");
        Handler handlerSpace = new HandlerSpace();
        Handler handlerMark = new HandlerMark();
        Handler handlerUpper = new HandlerUpper();

        handlerSpace.setNextHandler(handlerMark);
        handlerMark.setNextHandler(handlerUpper);

        System.out.println(handlerSpace.handleRequest("..,,hello,   world."));
        System.out.println("------------责任链模式-案例-采购审批链--------------");

        Approver director=new Director("王主任");
        Approver vicePresident=new VicePresident("李副董");
        Approver president=new President("孟董");
        Approver congress=new Congress();

        director.setSuccessor(vicePresident);
        vicePresident.setSuccessor(president);
        president.setSuccessor(congress);

        director.processRequest(new PurchaseRequest(128000,100,"音律联觉门票100张"));

    }
}